<template>
  <div class="back-header">
    <el-page-header @back="goBack" :content="titleName"> </el-page-header>
  </div>
</template>

<script>
export default {
  name: "back-header",
  components: {},
  props: {
    pageTitle: {
      type: String,
      default() {
        return ''
      },
    },
  },
  data() {
    return {};
  },
  computed: {
    titleName() {
      const systemMenuArray = this.$store.getters.systemMenuArray;
      const currentPath = this.$route.path;
      const pageItem = systemMenuArray.find(item => {
        return item.path === currentPath;
      }) || {};
      return this.pageTitle || pageItem.title;
    }
  },
  mounted() { },
  methods: {
    goBack() {
      this.$router.back();
    },
  },
};
</script>
<style lang='scss' scoped>
.back-header {
  margin: 0 10px 10px 10px; 
  padding-bottom: 10px;
  border-bottom: 1px solid #ebecef;
}
</style>
